# 141 Linked List Cycle

# 走到终点，是否是null

# Set 存储，判断重复

# 快慢指针

def hasCycle(self, head):
    fast = slow = head
    while slow and fast and fast.next:
        slow = slow.next
        fast = fast.next.next
        if slow is fast:
            return True
    return False